import sun.misc.Launcher;

import java.net.URL;
import java.util.Arrays;

/**
 * @author zhu_shuai
 * @since 2021/6/1
 */
public class Demo3ClassLoader {
    // 根类加载器/启动类加载器， 扩展类加载器， 系统类加载器
    public static void main(String[] args) {
        URL[] urLs = Launcher.getBootstrapClassPath().getURLs();
        Arrays.stream(urLs).forEach(System.out::println);

        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        ClassLoader parent = systemClassLoader.getParent();
        System.out.println(systemClassLoader.toString());
        System.out.println(parent.toString());
        System.out.println(parent.getParent().toString());
    }

}
